package IO;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class IODemo8Reader {
    public static void main(String[] args) {
        //Reader 和 writer 读写的是文本文件，提供了一组类，统称为“字符流”
        try(Reader reader = new FileReader("d:/test.txt")) {
            while(true) {
                int c = reader.read();  //转成ascii码
                if(-1 == c) {
                    break;
                }
                System.out.println(c);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
